home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Techniques / Examples by Geoff Perlman / Classes / Calendar / Read Me < prev   
Encoding:
Text File  |  2001-01-30  |  2.6 KB  |  64 lines

  1. Calendar Class (v1.0) Example
  2. By Geoff Perlman
  3. January 30th, 2001
  4.  
  5. Copyright Notice
  6. The source code to this class is copyright 2001 REAL Software, Inc.
  7. You may use and modify this for your own projects. However, this class or any class derived from it may not be resold separately without the expressed written consent of REAL Software, Inc.
  8.  
  9. Introduction
  10. This class draws a calendar and gives you quite a bit of flexibility in how the calendar actually draws as well as responding to user events. The names of the days of the week automatically change to fit the size of the calendar.
  11.  
  12. Properties
  13. Here are the properties you can access and their default values:
  14.  
  15. colorDepth = 8
  16. FontName = "Helvetica"
  17. FontSize = 12
  18. selectionType = 1 //allow one day to be selected
  19.  
  20. The available selection types are:
  21. 'SelectionType:
  22. '0 = none
  23. '1 = single day
  24. '2 = multiple days (discontigous)
  25.  
  26.  
  27. These properties control the colors used for drawing. If you are sure what a particular color is, let me know.
  28.  
  29. daysNotInMonthColor = rgb(204,204,204) //medium grey
  30. dayNumbersNotInMonthColor =  rgb(120,120,120) //dark grey
  31. dayNumberBoxesNotInMonthColor = rgb(186,186,186) //darker grey
  32. TodayBoxNumberColor = rgb(0,0,0) //black
  33. TodayNumberColor = rgb(255,255,255) //white
  34. WeekendCellColor = rgb(237,237,237)
  35. WeekendNumberColor = rgb(0,0,0) //black
  36. WeekendNumberBoxColor = rgb(204,204,204)
  37. WeekdayCellColor = rgb(255,255,255)
  38. WeekdayNumberColor = rgb(0,0,0) //black
  39. WeekdayNumberBoxColor = rgb(222,222,222)
  40.  
  41. You can set all of the above properties in the Open event of your calendar class on your window to override the defaults.
  42.  
  43. Other properties you will need to know about:
  44. CalendarDate as Date //the currently selected date
  45. DatesSelected(0) as Date //array of all selected dates
  46. version as string // the version number of the calendarclass
  47. DrawGraphics //when set to false, calendar draws day names and numbers only (no lines or boxes)
  48. DrawCalendarInto //pass it a graphics object and the calendar will be draw into it.
  49. DayNameStyle
  50. 0 = draw full name if possible
  51. 1 = draw abbreviated name if possible
  52. 2 = draw first letter of day name
  53.  
  54. Events
  55. Open //obvious enough
  56. Change //fires when the user selects another date. the date selected is passed in.
  57. Doubleclick //fires when the user double-clicks a date. the date clicked is passed in.
  58.  
  59. Methods:
  60. DateIsSelected(date) returns true if the date passed is currently selected.
  61. NextMonth //changes the display of the calendar to the next month
  62. PreviousMonth //changes the display of the calendar to the previous month
  63. SetDate(date) //changes the display of the calendar to the month of the date passed
  64.